package com.itgungnir.designpattern.interpreter;

public class VariableExpression extends Expression {
	private Integer value;

	public VariableExpression(String key, Integer value) {
		super.key = key;
		this.value = value;
	}

	public Integer getValue() {
		return value;
	}

	@Override
	public Expression interpret(Context context) {
		context.addVariable(super.key, value);
		return this;
	}
}